<?php
/**
 * Constant888 is a singleton pattern (only one instance of this class is allowed to instantiate
 * Reference: http://www.weberdev.com/get_example-4002.html
 */

if (!defined("CONSTANT888_PHS")) {
	define("CONSTANT888_PHS",1);
	class File {
		static private $instance;

		private $path;
		private $hehe;

		private function File() {
			$this -> path = dirname(__FILE__).'\Smarty-2.6.26';
			$this -> hehe = "HEhe";
		}
		
		static public function instance() {
			if (!self::$instance) {
				self::$instance = new File();		
			}			
			return self::$instance;		
		}

		public function value($constName) {
			return $this -> $constName;
		}
	}

	$afile = File::instance();
	echo ($afile -> value("path"));
	echo ($afile -> value("hehe"));
	

}
?>